home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / forth / pfe-0.000 / pfe-0 / pfe-0.9.13 / src / block.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-17  |  2.2 KB  |  109 lines

  1. /*
  2.  * This file is part of the portable Forth environment written in ANSI C.
  3.  * Copyright (C) 1995  Dirk Uwe Zoller
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU Library General Public
  7.  * License as published by the Free Software Foundation; either
  8.  * version 2 of the License, or (at your option) any later version.
  9.  *
  10.  * This library is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13.  * See the GNU Library General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU Library General Public
  16.  * License along with this library; if not, write to the Free
  17.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  * This file is version 0.9.13 of 17-July-95
  20.  * Check for the latest version of this package via anonymous ftp at
  21.  *    roxi.rz.fht-mannheim.de:/pub/languages/forth/pfe-VERSION.tar.gz
  22.  * or    sunsite.unc.edu:/pub/languages/forth/pfe-VERSION.tar.gz
  23.  * or    ftp.cygnus.com:/pub/forth/pfe-VERSION.tar.gz
  24.  *
  25.  * Please direct any comments via internet to
  26.  *    duz@roxi.rz.fht-mannheim.de.
  27.  * Thank You.
  28.  */
  29. /*
  30.  * block.c ---                The Optional Block Word Set
  31.  * (duz 19Jul93)
  32.  */
  33.  
  34. #include "forth.h"
  35. #include "support.h"
  36.  
  37. #include <string.h>
  38. #include <limits.h>
  39.  
  40. #include "missing.h"
  41.  
  42. Code (block)
  43. {
  44.   *sp = (Cell) block (BLOCK_FILE, *sp);
  45. }
  46.  
  47. Code (buffer)
  48. {
  49.   int n;
  50.  
  51.   *sp = (Cell) buffer (BLOCK_FILE, *sp, &n);
  52. }
  53.  
  54. Code (empty_buffers)
  55. {
  56.   empty_buffers (BLOCK_FILE);
  57. }
  58.  
  59. Code (flush)
  60. {
  61.   save_buffers_ ();
  62.   empty_buffers_ ();
  63. }
  64.  
  65. Code (list)
  66. {
  67.   list (BLOCK_FILE, SCR = *sp++);
  68. }
  69.  
  70. Code (load)
  71. {
  72.   load (BLOCK_FILE, *sp++);
  73. }
  74.  
  75. code (save_buffers)
  76. {
  77.   save_buffers (BLOCK_FILE);
  78. }
  79.  
  80. Code (thru)
  81. {
  82.   int hi = *sp++;
  83.   int lo = *sp++;
  84.  
  85.   thru (BLOCK_FILE, lo, hi);
  86. }
  87.  
  88. code (update)
  89. {
  90.   update (BLOCK_FILE);
  91. }
  92.  
  93. /* *INDENT-OFF* */
  94. LISTWORDS (block) =
  95. {
  96.   SV ("BLK", BLK),
  97.   CO ("BLOCK", block),
  98.   CO ("BUFFER", buffer),
  99.   CO ("EMPTY-BUFFERS", empty_buffers),
  100.   CO ("FLUSH", flush),
  101.   CO ("LIST", list),
  102.   CO ("LOAD", load),
  103.   CO ("SAVE-BUFFERS", save_buffers),
  104.   SV ("SCR", SCR),
  105.   CO ("THRU", thru),
  106.   CO ("UPDATE", update)
  107. };
  108. COUNTWORDS (block, "Block + extensions");
  109.